import type { ComputedRef, Ref } from 'vue';
import type { FormActionType, FormProps, FormSchema, Recordable } from './form';
import { dayjs } from 'element-plus';
import type { EmitType } from '../common/gloab';

export interface UseFormActionContext {
  emit: EmitType;
  getProps: ComputedRef<FormProps>;
  getSchema: ComputedRef<FormSchema[]>;
  formModel: Recordable;
  defaultValueRef: Ref<Recordable>;
  formElRef: Ref<FormActionType>;
  schemaRef: Ref<FormSchema[]>;
  handleFormValues: Fn;
}

declare interface Fn<T = any, R = T> {
  (...arg: T[]): R;
}
export const dateUtil = dayjs;
